A microcontroller illustrated 1 in FIG. 14 has been disclosed in U.S. Pat. No. 5,619,430 corresponding to JP-A-H10-503611. The microcontroller 1 includes a temperature sensor 2. As illustrated in FIG. 15, the temperature sensor 2 includes a ΔVbe generator 350 and a differential amplifier 352 for generating an output voltage Vout, which is supplied to one input of a multiplexer (MUX) 4 for sampling by a slope analog-to-digital (A/D) converter 3.
The ΔVbe generator 350 includes PNP bipolar transistors 354, 355 having bases connected to each other and emitters connected to a ground. A collector of the transistor 354 is coupled through a resistor 360 to a source of a N-channel metal-oxide semiconductor (MOS) transistor 356, and a collector of the transistor 355 is coupled to a source of a N-channel MOS transistor 357.
The transistors 356-359 supply a bias current I to the collectors of the transistors 354, 355. The transistors 354, 355 are designed such that the area of each emitter is different. A difference in base-emitter voltages across the transistors 354, 355 appears across the resistor 360, as denoted by ΔV. The amplifier 352 amplifies the voltage ΔV by an amplification gain A. Therefore, the output voltage Vout is expressed as follows by using a temperature T: Vout=ΔV×A=K1×T. Since K1 is a constant, the output voltage Vout changes linearly with the temperature T.
The A/D converter 3 samples the output voltage Vout of the amplifier 352, and a central processing unit (CPU) 5 receives a digital value corresponding to the output voltage Vout from the A/D converter 3. In order to obtain an absolute temperature, the microcontroller 10 is calibrated at factory test whereby the output voltage of the temperature sensor 2 is measured at two different temperatures. This will enable one to obtain calibration constants Kthrm and Ktc. The CPU 5 corrects the temperature detected by the temperature sensor 2 by using the calibration constants Kthrm and Ktc.
However, in the microcontroller 1 disclosed in U.S. Pat. No. 5,619,430, the CPU 5 performs the correction of the temperature by software. Further, regarding the A/D converter 3, the CPU 5 must perform correction by using a calibration constant Kref to determine coefficients of a linear transfer function. Therefore, complex correction procedures are required to accurately detect a temperature.